import MessageTips from '@/components/message-tips/prompt.vue'

export const useMessage = () => {


    const alertMessage = (text, type = 'warning') => {
        ElMessage({
            message: text,
            type,
            dangerouslyUseHTMLString: true
        })
    }


    const confirmMessage = (text) => {

        return ElMessageBox({
            message: h(MessageTips, {
                text,
            }),
            customClass: 'reconfirm-message',
            showCancelButton: true,
            showConfirmButton: true,
            confirmButtonText: '确认',
            cancelButtonText: '取消',
        })
    }

    return {
        alertMessage,
        confirmMessage
    }
}
